package org.lc.stk.model.question.attrs;

import org.hibernate.annotations.Comment;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;

/**
 * 试题属性
 * 用于扩展试题的额外属性，如难度、重要性等
 */
@Entity
@Table(name = "stk_question_attribute")
@Comment("试题属性")
public class QuestionAttribute {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(length = 50, nullable = false, unique = true)
    @Comment("属性代码")
    private String code;

    @Column(length = 100, nullable = false)
    @Comment("属性名称")
    private String name;

    @Column(length = 500)
    @Comment("属性描述")
    private String description;

    @Column(nullable = false)
    @Comment("是否启用")
    private Boolean enabled = true;

    @Column(nullable = false)
    @Comment("排序号")
    private Integer sortOrder = 0;

    protected QuestionAttribute() {
    }

    public QuestionAttribute(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public Long getId() {
        return id;
    }

    protected void setId(Long id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Boolean getEnabled() {
        return enabled;
    }

    public void setEnabled(Boolean enabled) {
        this.enabled = enabled;
    }

    public Integer getSortOrder() {
        return sortOrder;
    }

    public void setSortOrder(Integer sortOrder) {
        this.sortOrder = sortOrder;
    }
}
